import React, { useEffect } from 'react';
import { observer } from 'mobx-react';
import Table from './Table';
import Form from './Form';
import FormPwd from './FormPwd';
import store from './store';
import rStore from '../role/store';

export default observer(function () {
  useEffect(() => {
    store.fetchRecords()
    rStore.fetchRecords()
  }, [])

  return (
    <React.Fragment>
      <Table />
      {store.formVisible && <Form />}
      {store.pwdFormVisible && <FormPwd />}
    </React.Fragment>
  )
})